Completed
Push — master ( aaf3ff...ce0105 )
by Fernando
02:47
created

wp.customize.bind(ꞌpreview-readyꞌ)   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
1
/**
2
 * Theme Customizer enhancements for a better user experience.
3
 *
4
 * This is the JS that runs on the site in the preview window
5
 */
6
7
( function( $ ) {
8
	
9
	// Update the site title in real time...
10
	wp.customize( 'blogname', function( value ) {
0 ignored issues
show
Bug introduced by
The variable wp seems to be never declared. If this is a global, consider adding a /** global: wp */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
11
		value.bind( function( newval ) {
12
			$( 'h1.site-title a' ).html( newval );
13
		} );
14
	} );
15
	
16
	//Update the site description in real time...
17
	wp.customize( 'blogdescription', function( value ) {
0 ignored issues
show
Bug introduced by
The variable wp seems to be never declared. If this is a global, consider adding a /** global: wp */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
18
		value.bind( function( newval ) {
19
			$( '.site-description' ).html( newval );
20
		} );
21
	} );
22
	
23
	//Update the headers layout.css
24
    wp.customize( 'lsx_header_layout', function( value ) {
0 ignored issues
show
Bug introduced by
The variable wp seems to be never declared. If this is a global, consider adding a /** global: wp */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
25
        value.bind( function( newval ) {
26
        	$( 'body' ).removeClass( 'header-central' );
27
        	$( 'body' ).removeClass( 'header-expanded' );
28
            $( 'body' ).addClass( 'header-'+ newval );
29
        } );
30
    });
31
32
    //Update the fixed header in real time...
33
	wp.customize( 'lsx_header_fixed', function( value ) {
0 ignored issues
show
Bug introduced by
The variable wp seems to be never declared. If this is a global, consider adding a /** global: wp */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
34
		value.bind( function( newval ) {
35
			if ( true == newval ) {
36
				$( 'body header.navbar' ).addClass( 'navbar-static-top' );
37
				$( 'body' ).addClass( 'top-menu-fixed');
38
			} else {
39
				$( 'body header.navbar' ).removeClass( 'navbar-static-top' );
40
				$( 'body' ).removeClass( 'top-menu-fixed' );
41
			}
42
		} );
43
	} );
44
	
45
    //Update the fixed header in real time...
46
	wp.customize( 'lsx_header_search', function( value ) {
0 ignored issues
show
Bug introduced by
The variable wp seems to be never declared. If this is a global, consider adding a /** global: wp */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
47
		value.bind( function( newval ) {
48
			
49
			if(true == newval){
50
				$('body #searchform').show();
51
			}else{
52
				$('body #searchform').hide();
53
			}
54
		} );
55
	} );
56
57
} )( jQuery );
58